import {createRouter, createWebHistory} from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'Manager',
      component: () => import('@/views/Manager.vue'),
      redirect: '/home',
      children: [
        { path: 'home', name: 'Home', component: () => import('@/views/manager/Home.vue')},
        { path: 'admin', name: 'Admin', component: () => import('@/views/manager/Admin.vue')},
        { path: 'member', name: 'Member', component: () => import('@/views/manager/Member.vue')},
        { path: 'slideshow', name: 'Slideshow', component: () => import('@/views/manager/Slideshow.vue')},
        { path: 'category', name: 'Category', component: () => import('@/views/manager/Category.vue')},
        { path: 'goods', name: 'Goods', component: () => import('@/views/manager/Goods.vue')},
        { path: 'supplier', name: 'Supplier', component: () => import('@/views/manager/Supplier.vue')},
        { path: 'stockorders', name: 'Stockorders', component: () => import('@/views/manager/Stockorders.vue')},
        { path: 'person', name: 'Person', component: () => import('@/views/manager/Person.vue')},
        { path: 'password', name: 'Password', component: () => import('@/views/manager/Password.vue')},
      ]
    },
    {path: '/login', component: () => import('@/views/Login.vue')},
    {
      path: '/front',
      name: 'front',
      component: () => import('@/views/Front.vue'),
      redirect: '/front/front_home',
      children: [
        { path: 'front_home', name: 'Front_home', component: () => import('@/views/front/Front_home.vue')},
      ]
    },
  ]
})

export default router
